from django import forms
from django.core import validators


class MessageBoardForm(forms.Form):
    title = forms.CharField(max_length=100, min_length=2, label="标题")
    content = forms.CharField(widget=forms.Textarea)
    email = forms.EmailField()
    reply = forms.BooleanField(required=False)


class MyForms(forms.Form):
    # email = forms.EmailField()
    # price = forms.FloatField(error_messages={"invalid":"请输入浮点"})
    # address = forms.URLField()
    phone = forms.CharField(validators=[validators.RegexValidator(r'^(13[0-9]|14[5|7]|15[0-9]|18[0|1|2|3|5|6|7|8|9])\d{8}$')])
